<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/5/23
  Time: 17:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<div class="row">
  <div class="col-lg-12">
    <div class="panel">
      <div class="panel-heading">
        <h3 class="panel-title">员工调动申请表</h3>
      </div>

      <!-- BASIC FORM ELEMENTS -->
      <!--===================================================-->
      <form id="form_transfer_input" class="panel-body form-horizontal form-padding">
        <input type="hidden" name="keyId" id="keyId" value="${transfer.id}" />
        <input type="hidden" name="parentId" id="parentId" value="${transfer.personnelInfo.id}" />


        <div class="form-group">
          <label class="col-md-2 control-label">用人性质<i class="fa fa-asterisk txt-color-red"></i></label>
          <div class="col-md-6">
            <input disabled type="text" id="nature" name="nature" class="form-control" value="${transfer.personnelInfo.personnelUse.nature==1?"正式":"试用"}">
          </div>
        </div>

        <div class="form-group">
          <label class="col-md-2 control-label">调动员工<i class="fa fa-asterisk txt-color-red"></i></label>
          <div class="col-md-6">
            <input disabled type="text" id="name" name="name" class="form-control" value="${transfer.personnelInfo.name}">
          </div>
        </div>

        <div class="form-group">
          <label class="col-md-2 control-label">调动原因<i class="fa fa-asterisk txt-color-red"></i></label>
          <div class="col-md-6">
            <input disabled type="text" id="reason" name="reason" class="form-control" placeholder="请输入调动原因" value="${transfer.reason}">
          </div>
        </div>

        <div class="form-group">
          <label class="col-md-2 control-label">
            <%--<c:if test="${transfer.numStatus>0}">部门</c:if>--%>
            <%--<c:if test="${transfer.numStatus==0}">--%>
              <%--<a href="javascript:void(0);" onclick="fn_departments_dialog_select('n','deptName','deptId')" style="color: #0a6dbd">部门</a>--%>
            <%--</c:if>--%>
              部门
            <i class="fa fa-asterisk txt-color-red"></i>
          </label>
          <div class="col-md-2">
            <input type="text" id="deptName" name="deptName" class="form-control" placeholder="请选择调往部门" disabled value="${transfer.department.name}">
            <input type="hidden" id="deptId" name="deptId" value="${transfer.department.id}">
          </div>

          <label class="col-md-2 control-label">
            <%--<c:if test="${transfer.numStatus>0}">岗位</c:if>--%>
            <%--<c:if test="${transfer.numStatus==0}">--%>
              <%--<a href="javascript:void(0);" onclick="fn_posts_dialog_select('n',$('#deptId').val(),'postName','postId')" style="color: #0a6dbd">岗位</a>--%>
            <%--</c:if>--%>
              岗位
            <i class="fa fa-asterisk txt-color-red"></i>
          </label>
          <div class="col-md-2">
            <input type="text" id="postName" name="postName" class="form-control" placeholder="请选择调往岗位" disabled value="${transfer.post.name}">
            <input type="hidden" id="postId" name="postId" value="${transfer.post.id}">
          </div>
        </div>

        <div class="form-group div-Hidden">
          <label class="col-md-2 control-label">原薪资<i class="fa fa-asterisk txt-color-red"></i></label>
          <div class="col-md-2">
            <input disabled type="text" class="form-control" id="oldSalary" name="oldSalary" value="${transfer.oldSalary}" />
          </div>
          <label class="col-md-2 control-label">调动后薪资<i class="fa fa-asterisk txt-color-red"></i></label>
          <div class="col-md-2">
            <input disabled type="number" class="form-control" id="newSalary" name="newSalary" placeholder="请输入调动后薪资" value="${transfer.newSalary}" />
          </div>
        </div>
        <div class="form-group">
          <label class="col-md-2 control-label">提交人</label>
          <div class="col-md-2">
            <p class="form-control-static">${transfer.creater.name}</p>
          </div>
          <label class="col-md-2 control-label">提交日期</label>
          <div class="col-md-2">
            <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${transfer.createTime}" /></p>
          </div>
        </div>
      </form>
      <!--===================================================-->
      <!-- END BASIC FORM ELEMENTS -->

      <div class="panel-footer">
        <a class="btn btn-default" id="apply-re-common" href="javascript:void(0)">
          <i class="fa fa-lg fa-mail-reply"></i> 返回视图
        </a>
        <c:if test="${transfer.numStatus==0 && user.id==transfer.creater.id}">
          <a class="btn btn-warning" key="ajax_transfer_edit" href="javascript:void(0);"><i class="fa fa-lg fa-edit"></i> 编辑表单 </a>
        </c:if>
      </div>
    </div>
  </div>
</div>

<script>

  //编辑
  $("a[key='ajax_transfer_edit']").unbind("click").bind("click",function(){
    loadURL("<%=path%>/activiti/transfer/edit/"+$("#keyId").val(),$('#page-content'));
  });

  //返回视图
  $("#apply-re-common").click(returnToHashUrl);

</script>